<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="myFn" uri="http://www.ethan.com/crm/permission"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>员工管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <%@include file="common.jsp"%>
    <script type="text/javascript" src="/js/views/employee.js"></script>
</head>
<body>

    <table id="emp_dg"></table>
    <%-- 数据表格的顶部功能按钮--%>
    <div id="emp_dg_tb">
        <div>
            <c:if test="${myFn:checkPermission('com.ethan.crm.web.controller.EmployeeController:saveEmployee')}">
                <a class="easyui-linkbutton" iconCls="icon-add" plain="false" data-cmd="add">新增</a>
            </c:if>
            <c:if test="${myFn:checkPermission('com.ethan.crm.web.controller.EmployeeController:updateEmployee')}">
                <a id="emp_dg_edit" class="easyui-linkbutton" iconCls="icon-edit" plain="false" data-cmd="edit">编辑</a>
            </c:if>
            <c:if test="${myFn:checkPermission('com.ethan.crm.web.controller.EmployeeController:deleteEmployee')}">
                <a id="emp_dg_del" class="easyui-linkbutton" iconCls="icon-remove" plain="false" data-cmd="del">离职</a>
            </c:if>
                <a class="easyui-linkbutton" iconCls="icon-reload" plain="false" data-cmd="reload">刷新</a>
        </div>
        <div>
            关键字查询： <input name="keyWord"><a class="easyui-linkbutton" iconCls="icon-search" data-cmd="searchBtn">搜索</a>
        </div>
    </div>


    <%--新增或更新编辑时候的对话框--%>
    <div id="emp_dialog">
        <%--对话框内增加需要提交的form表单--%>
        <form id="emp_form" method="post">
            <table align="center" style="margin-top: 15px">
                <input type="hidden" name="id">
                <tr>
                    <td>账号</td>
                    <td><input type="text" name="username"/></td>
                </tr>
                <tr>
                    <td>真实姓名</td>
                    <td><input type="text" name="realname"/></td>
                </tr>
                <tr>
                    <td>联系方式</td>
                    <td><input type="text" name="tel"/></td>
                </tr>
                <tr>
                    <td>邮箱</td>
                    <td><input type="text" name="email"/></td>
                </tr>
                <tr>
                    <td>部门</td>
                    <td>
                        <input type="text" name="dept.id" class="easyui-combobox"
                               data-options="editable:'false', valueField:'id', textField:'name', url:'/department_queryForEmployee'">
                    </td>
                </tr>
                <tr>
                    <td>入职时间</td>
                    <td><input type="text" name="inputtime" class="easyui-datebox"/></td>
                </tr>
                <tr>
                    <td>角色</td>
                    <td>
                        <input id="emp_roles" type="text" class="easyui-combobox"
                               data-options="valueField:'id', textField:'name', url:'/role_queryForEmployee', multiple:true">
                    </td>
                </tr>
            </table>
        </form>
    </div>

    <%--定义按钮框，附在新增和编辑员工的对话框emp_dialog中--%>
    <div id="emp_dialog_bt">
        <a class="easyui-linkbutton" iconCls="icon-save" plain="false" data-cmd="save">保存</a>
        <a class="easyui-linkbutton" iconCls="icon-cancel" plain="false" data-cmd="cancel">取消</a>
    </div>
</body>
</html>
